package com.ysd.lis.controller.self;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.slef.SelfMachineType;
import com.ysd.lis.entity.sta.StaFeeItem;
import com.ysd.lis.request.FeeItemPageParam;
import com.ysd.lis.service.self.SelfMachineTypeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author whx
 * @since 2025-05-12
 */
@RestController
@RequestMapping("/self/machine/type")
public class SelfMachineTypeController extends BaseController {

    @Autowired
    SelfMachineTypeService machineTypeService;

    @ApiOperation("获取申请项目")
    @GetMapping("/findMachineTypeList")
    public Result findMachineTypeList(FeeItemPageParam feeItemPageParam) {
        return machineTypeService.findMachineTypeList(feeItemPageParam);
    }

    @ApiOperation("新增或编辑申请项目")
    @PostMapping("/savaOrUpdateMachineType")
    public Result savaOrUpdateMachineType(@RequestBody SelfMachineType machineType) {
        return machineTypeService.savaOrUpdateMachineType(machineType);
    }

    @ApiOperation("删除申请项目")
    @PostMapping("/deleteMachineType")
    public Result deleteMachineType(@RequestBody List<SelfMachineType> machineTypeList) {
        return machineTypeService.deleteMachineType(machineTypeList);
    }
}
